<template>
	<view>
		<u-gap height="10" bgColor="#f3f4f6"></u-gap>
		<view class="under">
			<u-button text="退出登录" color="linear-gradient(to right, rgb(66, 83, 216), rgb(213, 51, 186))"
				@click="logout">
			</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			logout() {
				//对信息进行记录并且跳转登录页
				uni.$u.toast("点击了按钮")
				uni.setStorage({
					key: 'is_login',
					data: 'no',
					success: function(res) {
						console.log(res);
					}
				})
				uni.setStorage({
					key: 'user_name',
					data: '',
					success: function(res) {
						console.log(res);
					}
				})

				uni.setStorage({
					key: 'user_token',
					data: '',
					success: function(res) {
						console.log(res);
					}
				})

				uni.redirectTo({
					url: '../../login/login'
				})
			}
		}
	}
</script>

<style>
	.under {
		bottom: 10px;
		position: fixed;
		width: 100%;
	}
</style>
